<?php  

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Bank extends CI_Controller {
	function __construct()
	{
		parent::__construct();
		$this->load->helper("url");
		$this->load->library("pagination");
		// check if user logged in 
		if (!$this->ion_auth->logged_in())
	  	{
			redirect('auth/login');
	  	}		
		$this->load->library('form_validation');
		$this->load->model('demo/bank_model');		
	}
		
    public function example1() {
        $config = array();
        $config["base_url"] = site_url('demo/bank/example1').'/'. "demo/bank/example1";
        $config["total_rows"] = $this->bank_model->record_count();
        $config["per_page"] = 20;
        $config["uri_segment"] = 3;

        $this->pagination->initialize($config);

        $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
        $data["results"] = $this->bank_model->
            fetch_countries($config["per_page"], $page);
        $data["links"] = $this->pagination->create_links();
	$this->load->view('common/header');
  	$this->load->view("demo/bank/view_bank", $data);
    $this->load->view('common/footer');	
    }

}
?>